package cn.ekuma.epos.toolcommand;

import java.awt.event.ActionEvent;

import javax.swing.AbstractAction;
import javax.swing.Action;

import com.openbravo.data.basic.BasicException;
import com.openbravo.pos.base.AppLocal;

public class CommandAction extends AbstractAction {

	I_Command comm;
	
	public CommandAction(I_Command comm) {
		putValue(Action.NAME, AppLocal.getIntString(comm.getCommandName()));
		this.comm = comm;
	}


	@Override
	public void actionPerformed(ActionEvent e) {
		try {
			comm.call();
		} catch (BasicException e1) {
			// TODO Auto-generated catch block
			e1.printStackTrace();
		}
		
	}

}
